package edu.dali.enterprise_test.service.product;

import edu.dali.enterprise_test.exception.UploadException;
import edu.dali.enterprise_test.model.Pager;
import edu.dali.enterprise_test.model.dto.InvoiceEntity;
import edu.dali.enterprise_test.model.vo.Dto;

import java.util.List;
import java.util.Map;

public interface ProductService {

    public Pager<Dto> getData(Dto dto);

    public Dto getProductById(Dto dto);

    public void addProduct(Dto dto);

    public void deleteProduct(String id);

    public void updateProduct(Dto dto);

    public List<Dto> productList(Dto dto);


    /**
     * 批量查询商品信息
     * @param invoiceEntity
     * @return
     */
    public Map<String , Object> productStockInfo(InvoiceEntity invoiceEntity);
    /**
     * 查询库存
     * @param id
     * @return
     */
    public int queryStock(String id);

    /**
     * 减少库存
     * @param dto
     */
    public void reduceStock(Dto dto);

    public Map<String , Object> queryStockByIds(Map<String ,Object> param );

    public void insertProducts(List<Map<String, String>> datas) throws UploadException;
}
